package model

// DockerContainer docker容器（在这里定义了Docker容器的模型compose）
type DockerContainer struct {
	ID            uint   `gorm:"primarykey;autoIncrement"`
	ContainerID   string `gorm:"column:container_id;not null"`
	Name          string `gorm:"column:name;not null"`
	Status        string `gorm:"column:status;not null"`
	Image         string `gorm:"column:image;not null"`
	ContainerName string `gorm:"column:container_name;not null"`
	Restart       string `gorm:"column:restart"`
	Networks      string `gorm:"column:networks;type:text"`    // 用JSON字符串存储网络数组
	Ports         string `gorm:"column:ports;type:text"`       // 用JSON字符串存储端口映射
	Volumes       string `gorm:"column:volumes;type:text"`     // 用JSON字符串存储卷映射
	Environment   string `gorm:"column:environment;type:text"` // 用JSON字符串存储环境变量
}

func (d *DockerContainer) TableName() string {
	return "docker_container"
}
